import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { EQUIPMENT_CODE, MARKER_TYPE, INCIDENT_CODE, OVERLAY_KEY } from '../service/map-data.service';

@Component({
    selector: 'itmp-clus-feat-overlay',
    templateUrl: './clus-feat-overlay.component.html',
    styleUrls: ['./clus-feat-overlay.component.css']
})
export class ClusFeatOverlayComponent implements OnInit {
    @Input() type: MARKER_TYPE;
    @Input() features = [];
    @Output() overlayEmit = new EventEmitter<{ type: MARKER_TYPE; feature: any }>();
    EQUIPMENT_CODE = EQUIPMENT_CODE;
    INCIDENT_CODE = INCIDENT_CODE;
    MARKER_TYPE = MARKER_TYPE;
    overlayKey = OVERLAY_KEY.CLUSTER_FEATURES_OVERLAY;

    constructor() {}
    showOverlay(type: MARKER_TYPE, data: any): void {
        this.overlayEmit.emit({
            type,
            feature: data
        });
    }

    ngOnInit() {}
}
